﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cloak.NUnit;
using Cloak.Reflection;
using NUnit.Framework;

namespace Ruleweaver.Rules
{
	public class CreateNotRule : Behavior
	{
		private CheckRule _rule;
		private NotRule _notRule;

		protected override void Given()
		{
			_rule = Rule.Check(Reflect.Func<ICheckable<int>, Check<int>>(Checkable.IsPositive));
		}

		protected override void When()
		{
			_notRule = Rule.Not(_rule);
		}

		[Then]
		public void RuleIsOriginal()
		{
			Assert.AreEqual(_rule, _notRule.Rule);
		}

		[Then]
		public void HasNotType()
		{
			Assert.AreEqual(RuleType.Not, _notRule.Type);
		}
	}
}